-
Notifications
You must be signed in to change notification settings - Fork 8k
dts: st: h7: fix dma stream #95803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dts: st: h7: fix dma stream #95803
Conversation
This change fixes DMA stream ID for H7xx series. DMA stream ID should be in range 1..N Signed-off-by: Mario Paja <[email protected]>
|
Thanks @mariopaja for this fix. I confirm that it does fix the issue. This is due to the update done within the PR #94869 which ensure to perform the DMA_OFFSET shift in all DMA function entry-points, leading to getting a -1 channel id for dcmi for example on the H7. |
Problem is that on some series (say F0), channel index starts from 1 and channels are bound to a dedicated peripheral (Ie channel 1 bound to ADC for instance). So we need to respect this, otherwise it'll make configuration quite hard. Coming back on the current issue, I need to have a deeper look. - dmas = <&dma1 0 75 (STM32_DMA_PERIPH_TO_MEMORY | STM32_DMA_PERIPH_NO_INC |
+ dmas = <&dmamux1 0 75 (STM32_DMA_PERIPH_TO_MEMORY | STM32_DMA_PERIPH_NO_INC | But then @mariopaja raises #93480 (comment) on which I don't have answer for now. I'll come back to you on this. |
On the stm32H7 which has a DMAMUX, use the dmamux for the corresponding peripheral request : (channel is the one from 0..15) for SAI 1 A request is 87 : for SAI 1 B request is 88 : And also enable DMAMUX1,DMA1,DMA2
|
@FRASTM you are correct about the request but channel of DMAMUX seems to be hardwired #93480 (comment) . And here starts my issue because it gives a limitation. For example SAI1 A & B nodes cannot be used simultaneously |
Did you try with SAI 1 A and SAI 2 B |
I will not be able to test it before 06/10. I think we have also drifted a bit from my issue. I tried to explain it once again at sai g4 PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved.
Talking directly to DMA instances is the only possible solution (today) for drivers implemented using HAL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per binding, this really shouldn't be needed. But issue seems to be caused by:
zephyr/include/zephyr/drivers/dma/dma_stm32.h
Lines 25 to 28 in 4a69c1b
#elif defined(CONFIG_DMA_STM32_V1) && defined(CONFIG_DMAMUX_STM32) | |
/* typically on the stm32H7 series, DMA V1 with mux */ | |
#define STM32_DMA_STREAM_OFFSET 1 | |
#else |
acceptable workaround until DMA stuff is cleaned up
Workaround for drivers that use HAL_OVERRIDE hack and skips Zephyr API. #93480 (comment)
This change fixes DMA stream ID for H7xx series for the following peripherals:
DMA stream ID should be in range 1..N
samples/drivers/i2s/output
Before:
After: